<template>
	<view>
		<view class="main">
			<u-loading mode="flower" color="blue" :show="flag" size="50"></u-loading>
		</view>
	</view>
</template>

<script>
	import { UserApi } from "../api/index.js"
	// import UserSession from "../../../common/session/User.js"
	export default {
		data() {
			return {
				flag:true,//loading显示
			};
		},
		methods:{},
		mounted() {
			 // let loginParams = {account: this.form.userName, password: this.form.password};
			  // let loginParams = {account: 'admin', password: 'GreenS0n'};
			  // UserApi.login(loginParams).then(res=>{
				 //  console.log(res);
				 //  // console.log(res.data.token);
				 //  uni.setStorageSync('token',res.data.token);
				 //  uni.setStorageSync("id",res.data.id);
				 //  // console.log(uni.getStorageSync('aaa'));
				 //    console.log("登录成功");
				 //  if(res.code=='SUCCEED'){
					//   this.flag=false
					//   uni.reLaunch({
					//   	url:"../../index/index"
					//   })
				 //  }
			  // })	
			  //第二个号
			  //领工011300069280
			  //报工011300061790
			   // let loginParamsA = {account: 'admin', password: 'GreenS0n'};
			  let loginParamsA = {account: '011300069280', password: '123456'};
			  UserApi.login(loginParamsA).then(res=>{
			  				  console.log(res);
			  				  // console.log(res.data.token);
			  				  uni.setStorageSync('tokenA',res.data.token);
			  				  uni.setStorageSync("idA",res.data.id);
			  				  // console.log(uni.getStorageSync('aaa'));
			  				    console.log("登录成功");
			  				  if(res.code=='SUCCEED'){
			  					  this.flag=false
			  					  uni.reLaunch({
			  					  	url:"../../index/index"
			  					  })
			  				  }
			  })	
		},
	}
</script>

<style lang="scss">
.main {
	width: 400rpx;
	height: 200rpx;
	margin: auto;
	text-align: center;
	line-height: 200rpx;
}
</style>
